import "package:ct_pa_majordomo/utils/request.dart";
import "package:dio/dio.dart";

class HomeApi {
  // 房态统计
  Future<Map> roomStatistics() async {
    Response response = await request.get(
      "apartment/statistics/room",
    );
    return response.data ?? {};
  }

  // 公寓统计
  Future<Map> apartmentStatistics() async {
    Response response = await request.get(
      "apartment/statistics/apartment",
    );
    return response.data ?? {};
  }

  // 账单统计
  Future<Map> billStatistics() async {
    Response response = await request.get(
      "apartment/statistics/bill",
    );
    return response.data ?? {};
  }


  // 入住趋势
  Future<Map> trendStatistics() async {
    Response response = await request.get(
      "apartment/statistics/trend",
    );
    return response.data ?? {};
  }

  // 用电统计
  Future<Map> electricityStatistics() async {
    Response response = await request.get(
      "apartment/record/statistics",
    );
    return response.data ?? {};
  }

  // 用电量趋势
  Future<Map> electricityTrend(queryParameters) async {
    Response response = await request.get(
      "apartment/record/trend",
      queryParameters: queryParameters,
    );
    return response.data ?? {};
  }
  
}

HomeApi homeApi = HomeApi();